package com.samphanie.security.security.service;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * 登录扩展
 *
 * @author Dries
 * @email 1451691457@qq.com
 */
public interface UserDetailsExtensionService extends UserDetailsService {

    /**
     * 根据手机号登录
     *
     * @param mobile 手机号
     * @return UserDetails
     * @throws UsernameNotFoundException 异常
     */
    UserDetails loadUserByMobile(String mobile) throws UsernameNotFoundException;

    /**
     * 根据社交账号登录
     *
     * @param openId 第三方的绑定的openId
     * @return UserDetails
     * @throws UsernameNotFoundException 异常
     */
    UserDetails loadUserBySocial(String openId) throws UsernameNotFoundException;
}
